﻿package mortal.component.windowTip
{
    import com.mui.controls.*;
    import mortal.common.global.*;
    import mortal.component.window.*;
    import mortal.game.manager.*;
    import mortal.game.view.common.*;
    import mortal.mvc.interfaces.*;

    public class WindowTip extends SmallWindow
    {
        private var _tip:GTextFiled;

        public function WindowTip(param1:ILayer = null)
        {
            super(param1);
            this.layer = LayerManager.topLayer;
            return;
        }// end function

        public function set data(param1:WindowTipData) : void
        {
            this._tip.width = param1.tipW;
            this._tip.height = param1.tipH;
            this._tip.htmlText = param1.tip;
            var _loc_2:* = this._tip.textWidth < 130 ? (130) : (this._tip.textWidth);
            this.setSize(_loc_2 + 30, this._tip.textHeight + 50);
            this._tip.width = _loc_2 + 10;
            this._tip.height = this._tip.textHeight + 10;
            this.updateSize();
            this.title = param1.title;
            this.layer.centerPopup(this);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._tip = UIFactory.gTextField("", 18, 38, 200, 200, this, GlobalStyle.textFormatPutong.setLeading(5));
            this._tip.wordWrap = true;
            this._tip.multiline = true;
            this._tip.mouseEnabled = false;
            pushUIToDisposeVec(this._tip);
            return;
        }// end function

    }
}
